<?php 

	session_start();

	include("functions.php");

	$idabstract = $_GET['idabstract'];

	$abstract = obtenerAbstractPorIdAbstract($idabstract);

	$congress = obtenerCongress($_SESSION['idcongress']);

	$abstractcontent = $abstract['ABSTRACT_TEXT'];
	
	$pdf = $abstract['PROCEEDING_PDF_PATH'];
	
	$urlpdf = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; 
	$urlpdf = str_replace("abstract_proceeding_viewer.php", "", $urlpdf);
	$urlpdf = str_replace("/","%2F", $urlpdf);

	$butCol = $congress['MENU_BUTTON_COLOR'];
	$butGradCol = $congress['MENU_BUTTON_GRADIENT_COLOR'];
	
	$butRolCol = $congress['ROLLOVER_BUTTON_COLOR'];
	$butRolGradCol = $congress['ROLLOVER_BUTTON_GRADIENT_COLOR'];

	$bgcolor = $congress['BACKGROUND_COLOR'];

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

	<title>Abstract / Proceedings</title>
	
	<style>
		
		body {
			padding: 0px;
			margin: 0px;
		}
		
		.bodybg {
			background: <?php echo $bgcolor; ?>
			filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='<?php echo $bgcolor; ?>', endColorstr='#FFFFFF');
			background: -webkit-gradient(linear, left top, left bottom, from(<?php echo $bgcolor; ?>), to(#FFFFFF));
			background: -moz-linear-gradient(top,  <?php echo $bgcolor ?>,  #FFFFFF);
			width: 100%;
			height: 600px;
		}
		
		.botonActivo {
			border: white solid thin; 
			padding: 0px; 
			background: <?php echo $butCol; ?>;
			color: white; 
			font-size: 12px;
			filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='<?php echo $butCol; ?>', endColorstr='<?php echo $butGradCol; ?>');
			background: -webkit-gradient(linear, left top, left bottom, from(<?php echo $butCol; ?>), to(<?php echo $butGradCol; ?>));
			background: -moz-linear-gradient(top,  <?php echo $butCol; ?>,  <?php echo $butGradCol; ?>);
			width: 320px;
			height: 40px;
			font-weight:bold;
		}
		
		.botonInactivo {
			border: white solid thin; 
			padding: 0px; 
			background-color: <?php echo $butRolCol; ?>;
			color: white; 
			font-size: 12px;
			filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='<?php echo $butRolCol; ?>', endColorstr='<?php echo $butRolGradCol; ?>');
			background: -webkit-gradient(linear, left top, left bottom, from(<?php echo $butRolCol; ?>), to(<?php echo $butRolGradCol; ?>));
			background: -moz-linear-gradient(top,  <?php echo $butRolCol; ?>,  <?php echo $butRolGradCol; ?>);
			width: 320px;
			height: 40px;
		}
	
	</style>
	
	<script>
		function activarAbstract() {
			document.getElementById('tab_abstract').style.display = 'block'; 
			document.getElementById('tab_proceeding').style.display = 'none';

			document.getElementById('btnAbstract').className = 'botonActivo';
			document.getElementById('btnProceeding').className = 'botonInactivo';			
		}
		
		function activarProceeding() {
			document.getElementById('tab_abstract').style.display = 'none'; 
			document.getElementById('tab_proceeding').style.display = 'block';
			
			document.getElementById('btnAbstract').className = 'botonInactivo';
			document.getElementById('btnProceeding').className = 'botonActivo';			
		}
	</script>
	
</head>

<body>
<div class="bodybg">

	<div align="center" style="padding: 5px;">
		<input type="button" onclick="activarAbstract();" value="Abstract" id="btnAbstract" class="botonActivo" />
		<input type="button" onclick="activarProceeding();" value="Proceeding" id="btnProceeding" class="botonInactivo" 
			<?php if (!$abstract['SHOW_PROCEEDING']) { ?> disabled="disabled" <?php } ?> />
	</div>
	
	<br />
	
	<div id="tab_abstract" style="width:100%;">
		<?php echo $abstractcontent; ?>
	</div>
	
	<div id="tab_proceeding" style="width:100%; display: none;" align="center">
	
		<iframe 
			src="http://docs.google.com/viewer?url=http%3A%2F%2F<?php echo $urlpdf ?>%2Fproceedings%2F<?php echo $pdf; ?>&embedded=true" 
			width="650" height="550" style="border: none;">
		</iframe>
	
	</div>

</div>
</body>
</html>
